home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / t_docs / rspf22p.txt < prev    next >
Text File  |  1996-06-25  |  87KB  |  1,687 lines

  1. (updated 2-feb) 
  2.                 Fred Goldstein   k1io
  3.                 goldstein@carafe.tay2.dec.com
  4.                 Version 2.2  2-feb-1992
  5.  
  6.      The Radio Shortest Path First (RSPF) Routing Protocol 
  7.         For Internet Protocol over Amateur Packet Radio 
  8.  
  9.         ** DRAFT ARCHITECTURE -- FOR COMMENT **
  10.  
  11. CONTENTS
  12.  
  13. I.   Introduction and Version Notes
  14. II.  Acquisition of router-router adjacencies
  15. III. Acquisition of end node adjacencies
  16. IV.  Link state propagation
  17. V.   The Shortest Path First Spanning Tree 
  18. Appendix A:  Router Parameters
  19. Appendix B:  Schematic Representation of RSPF Tables
  20.  
  21. [note:  Significant changes to Version 2.1 are flagged in this text 
  22. with "**".]
  23.  
  24. I.  Introduction
  25.  
  26. The packet radio environment is a very difficult one for TCP/IP to run
  27. on.  As typically implemented in the Amateur Service, it provides very
  28. low bandwidths within severely constrained implementations.  The most
  29. common radio technology has been 1200 baud single-frequency operation,
  30. although higher speeds and some full-duplex operation are also found.
  31. Virtually all amateur packet radio TCP/IP activity (the AMPRnet) makes
  32. use of personal computers, most with severely constrained memory address
  33. space.
  34.  
  35. In this environment, automatic routing of IP packets has not been the
  36. norm.  Routing protocols designed for other environments are rarely
  37. satisfactory.  Manual route tables are common.  Most amateur packet
  38. radio operation to date does not even make use of IP; instead, it
  39. converges applications directly upon a source-routed frame relaying
  40. protocol called AX.25.  Improved routing support will be an important
  41. factor in the success of IP.
  42.  
  43. Many IP and other wireline networks have implemented link state routing
  44. based upon Dijkstra's "SPF" (shortest path first) spanning tree
  45. algorithm.  A wireline implementation of SPF for IP is being
  46. standardized as the Open SPF Interior Gateway Protocol (OSPF), and an
  47. SPF procedure has been accepted by ISO as the standard "IS-IS" routing
  48. protocol for OSI connectionless networks [ISO10589].  A similar (and
  49. derivative) procedure can be applied to AMPRnet (Net 44) and perhaps to
  50. similarly-constrained packet radio networks.  It is called Radio
  51. Shortest Path First (RSPF);  this document describes the RSPF protocol,
  52. version 2.2.
  53.  
  54. RSPF occupies the role traditionally referred to in TCP/IP networks as
  55. an "Interior Gateway Protocol" (IGP), where "Gateway" means "router".
  56. It makes use of the services of the Internet Protocol.  It is not
  57. inconceivable that a router could use both RSPF and another IGP, or
  58. communicate with another network using the Exterior Gateway Protocol
  59. (EGP).  However these scenarios are not described in this document.
  60.  
  61. RSPF is intended to be implemented on nodes which serve as routers; its
  62. implementation on end nodes is optional, and not required for the end
  63. nodes to take advantage of routing services.  Any IP station may be an
  64. end node giving no further consideration to routing.
  65.  
  66.  
  67. I.1. Elements of RSPF
  68.  
  69. The RSPF protocol is designed for use by Internet-layer routing nodes (IP 
  70. Gateways) in a packet radio network using the Internet Protocol.  It is
  71. comprised of four major functions:
  72.  
  73.     1) Acquisition of router-router adjacencies
  74.     2) Acquisition of end node adjacencies
  75.     3) Link state propagation
  76.     4) Spanning tree route decision making.
  77.  
  78. Its net result is the automatic maintenance of a least-cost routing 
  79. table for use by IP Routing.  RSPF is optimized for the geographically
  80. heirarchical addressing used in AMPRnet, but does not depend upon it. 
  81.  
  82. RSPF is simpler than OSPF and IS-IS, as it is principally designed for
  83. personal computer implementation within the Amateur Radio Service.  It
  84. also adds procedures to take advantage of packet radio's
  85. "semi-broadcast" nature.
  86.  
  87.  
  88. I.2. Addressing convention
  89.  
  90. When an RSPF router communicates with an end node, it will typically
  91. deal with a 32 bit IP address.  Routers themselves, however, also
  92. support node group addressing (fewer than 32 bits need match).  This
  93. follows the convention in the KA9Q NOS IP routing program, which permits
  94. a crude form of heirarchical addressing as well as allowing portable
  95. operations to override the defaults.  RSPF looks for the match (node or
  96. node group) with the greatest number of matching bits.  Only if the
  97. number of bits matched is equal, then the lower cost path will be used.
  98.  
  99. Thus a match to a full node address will override a "cheaper" path that
  100. matches its "subnet" (node group) of 24 bits, which overrides a 16-bit
  101. node group, etc., noting that AMPRnet node groups need not follow rigid
  102. IP subnetting rules, and that AMPRnet is a single Class A net.  In every
  103. case, a greater number of bits matched is considered a superior path to
  104. a destination than one that matches fewer bits, regardless of the value
  105. of the routing metric ("cost").
  106.  
  107. **An extension of this is the handling of manual routes, which are
  108. routes defined by a manual entry into a table.  Manual routes provide a
  109. useful starting point during the RSPF convergence, and are required when
  110. RSPF implementation in a given area is limited.  As an order of
  111. precedence, whether a route is manual or RSPF-generated should only be
  112. used to break ties equal in both subnet size and cost; RSPF-generated
  113. routes then take precedence.
  114.  
  115.  
  116. I.3  Subnetworks 
  117.  
  118. The generic term used herein for the layer directly beneath IP, creating
  119. the adjacency between two IP nodes, is subnetwork.  A routing protocol
  120. gains efficiency by recognizing the nature of all subnetworks that it
  121. supports.  RSPF is intended to work across a specific set of subnetworks
  122. that occur in packet radio.  (Note that this use of "subnetwork" is
  123. consistent with OSI terminology; the function of the IP "subnet mask" in
  124. other IP routing protocols is herein referred to as "node group".)
  125.  
  126. I.3.1.  Classification by topology
  127.  
  128. All subnworks may be classified according to topology.  An initial
  129. division is made between broadcast-topology subnetworks and
  130. general-topology subnetworks.  
  131.  
  132. I.3.1.1  Broadcast topology.  A broadcast-topology subnetwork is one in
  133. which a node may send a single packet which is propagated to all other
  134. nodes, which receive it with high probability.  Ethernet and FDDI are
  135. examples of broadcast-topology subnetworks.
  136.  
  137. I.3.1.2.  General topology.  A general-topology subnetwork is any that
  138. does not offer a reasonably reliable broadcast service.  Within this
  139. classification, an extreme case is a point-to-point subnetwork, with
  140. only two nodes.  Examples of point-to-point subnetwork protocols are
  141. PPP, SLIP and LAP-B.
  142.  
  143. Packet-switched networks are typically general-topology, with wireline
  144. networks conforming to CCITT Recommendation X.25 being one example.
  145.  
  146. Another general-topology subnetwork found in packet radio is the type
  147. implemented by "TheNet" (from NordLink) and its clones.  Its network
  148. layer offers a datagram service to an addressed point, not a useful
  149. broadcast service, and again with no guarantee of delivery.
  150.  
  151. I.3.1.3.  Topologies found in packet radio.  Within the amateur packet
  152. radio world, an example of a broadcast-topology subnetwork might be a
  153. packet "LAN" implemented using a full-duplex RF repeater.  However,
  154. these are relatively rare; the typical single-frequency radio "LAN"
  155. using CSMA or Aloha operation, typified by AX.25 subnetworks, fails the
  156. test of broadcast topology.  It loses too many packets for routing to be
  157. able to trust unacknowledged delivery.  This is often due to the "hidden
  158. transmitter syndrome" (HTS), the details of which are beyond the scope
  159. of this document.  However, some steps may be taken in order to make use
  160. of the near-broadcast nature of these "LANs".  These are "semi-
  161. broadcast" subnetworks.
  162.  
  163. I.3.2.  Adjacencies and Subnetwork Access Points
  164.  
  165. The purpose of any subnetwork is to create adjacencies between IP nodes.
  166. Each IP node is identified at the IP layer by its IP address.  Each node
  167. in turn identifies each of its adjacencies as a Subnetwork Access Point
  168. (SNAcP).  A SNAcP is identified within the router by the 2-tuple
  169. {Subnetwork address, Hardware port}.  In the case of a point-to-point
  170. subnetwork, the subnetwork address component is null.  In the case of
  171. some other subnetworks, it may be almost arbitrarily complex.  For
  172. example, an AX.25 "address" may consist of a string of addresses by
  173. which the AX.25 subnetwork performs source-routed frame relaying.
  174.  
  175. Thus the actual routing information includes 3-tuples consisting of the
  176. IP destination address or node group as the key, followed by the two
  177. elements of the SNAcP.  The output of RSPF is this routing table.
  178.  
  179.  
  180. I.3.3. Connection-oriented vs. connectionless subnetworks
  181.  
  182. IP is a connectionless (datagram) network protocol, and supports both
  183. connection-oriented (virtual circuit) and connectionless (datagram)
  184. lower layers (subnets).  In a network with a high packet loss rate, the
  185. local retransmission provided by a connection-oriented datalink may
  186. substantially improve overall throughput.  However, in a high-speed
  187. dedicated backbone, particularly one implemented using full-duplex radio
  188. or wireline links, connectionless links may provide better overall
  189. performance.  The choice of which to use is a local matter; RSPF will
  190. work with both.  
  191.  
  192. **Connection-oriented subnetworks are assumed here to operate in assured
  193. mode, as is provided with LAP-B.  No connection-oriented non-assured
  194. subnets, such as wireline Frame Relay, are contemplated for packet radio
  195. RSPF use at this time.
  196.  
  197. The reliability of the routing information, however, may be somewhat
  198. greater with connection-oriented datalink procedures.  This occurs 
  199. both because the link will have more reliable propagation of network
  200. state information, and because these will give more rapid indication of
  201. a physical link failure.  In a true broadcast-topology subnetwork,
  202. connectionless operation should suffice.   Much of RSPF's uniqueness
  203. comes from permitting connectionless operation over unreliable media, a
  204. combination that appears to be in much demand within the AMPRnet
  205. community.
  206.  
  207.  
  208. I.4. Relationship to other protocols
  209.  
  210. All packets specific to RSPF shall be exchanged inside IP packets using
  211. a protocol identifier which, pending formal assignment of one, shall be
  212. 73.  Such IP packets shall be sent with a time to live (TTL) value of 1.
  213. If broadcast procedures are used over AX.25, connectionless AX.25 UI
  214. frames shall be sent, with a broadcast address "QST-0" in the AX.25
  215. address and **an IP address ending in [.255], indicating multicast.
  216. This permits different ports on a router to have different broadcast
  217. addresses.  (A router can also "read the mail" on passing radio packets
  218. not addressed to it; such procedures are for further study.)  Equivalent
  219. procedures may be developed for other subnetworks.
  220.  
  221. Note that in this document, "subnetwork" and "data link" are synonymous,
  222. and refer to the layer over which IP packets are exchanged.  
  223.  
  224. I.5.  Change history
  225.  
  226. I.5.1.  Changes for Version 2.1. (October, 1989)
  227.  
  228. RSPF draft 2.0 was released in June, 1988, as the first nearly-
  229. implementable version.  It was first implemented in September, 1989 by
  230. Anders Klemets.  Version 2.1 reflects changes whose need was discovered
  231. during this implementation.  These changes are both editorial and, in a
  232. few cases, substantive.
  233.  
  234. The format of the Routing Update packet was slightly modified.  In order
  235. to prevent fragments of two or more different routing update messages
  236. from being erroneously merged, an Envelope ID was added to each such
  237. packet, with the same Envelope ID on all fragments of a multi-packet
  238. message.  The term for such a message is now "envelope";  it contains
  239. one or more "bulletins", each of which originated from a single router.
  240.  
  241. There are no longer separate packet types for Full Routing Update and
  242. Partial Routing Update.  Instead, they are distinguished by the value of
  243. the subsequence number, which is always 0 for Full Routing Updates and
  244. is never 0 for Partial Routing Updates.  A given envelope may contain
  245. both types of bulletin.
  246.  
  247. Cost is now set on the basis of receiver instead of transmitter.  This
  248. permits the automatic link quality adjustment to operate on the basis
  249. of locally-received traffic.
  250.  
  251. It is explicitly stated that upon creation of a new router-router
  252. adjacency, the routers exchage full routing information.  This allows
  253. routers to initialize themselves with a reasonably complete map of the
  254. network.
  255.  
  256. 1.5.2.  Changes for Version 2.2 (January, 1992)
  257.  
  258. Version 2.1 was actually implemented and deployed in several locations,
  259. providing a useful input to this version.  The changes in Version 2.2
  260. are intended to be compatible, at the message level, with Version 2.1;
  261. however, the internal organization is different.  This should preserve
  262. interoperability in the face of several changes.  Some descriptive
  263. changes were made in this document in order to make it less dependent
  264. upon any one implementation or network.
  265.  
  266. The major change is the generalization of the subnetwork and the SNAcP;
  267. this allows arbitrary subnetworks to be converged under RSPF.  Behavior
  268. of "private" and "manual" routes is also now explicitly described.
  269.  
  270. The behavior of RSPF in acquiring new adjacencies is also clarified with
  271. a new state machine.  A connectionless adjacency is never put into
  272. general use until it is successfully tested.  This fixes an ambiguity in
  273. Version 2.1 which led to the immediate creation of a "suspect" route
  274. upon receipt of a Router-Router Hello message, even if it failed
  275. successive pings.  
  276.  
  277. Sequence number behavior for bulletins is also clarified, with a new
  278. initialization procedure.  The number space is now linear and finite. 
  279.  
  280.  
  281. II.  Acquisition of router-router adjacencies
  282.  
  283. For RSPF to operate correctly, all routers must remain reasonably
  284. current as to the state of the network at large.  This is handled by the
  285. propagation of "bulletin" messages among routers.  End nodes need not
  286. concern themselves with this; they will normally communicate through one
  287. selected router at any given time, for all (non-adjacent) destinations
  288. (not seen by ARP or other lower-layer procedures).  End nodes can also,
  289. of course, connect to each other directly, bypassing RSPF.
  290.  
  291. Each router maintains an adjacencies table.  Each router's adjacency
  292. table lists the following information for all other nodes, both routers
  293. and end nodes, from which it directly receives packets over a
  294. subnetwork:
  295.  
  296.     Adjacent node IP address (i.e., 44.56.4.44)
  297.     Adjacent node subnetwork (eg.,AX.25) address (eg., K1IO-0)
  298.     Subnet (hardware) used (i.e., AX0)
  299.     Subnet cost (i.e., 4)
  300.     Number of packets heard since last RRH update (i.e., 50)
  301.     Packet sequence number in last RRH update (i.e., 2593)
  302.     Time of last RRH update (i.e., 2130).
  303.         **Link state (tentative, good, suspect, lost)
  304.         **Type of service (connection-oriented, connectionless)
  305.  
  306.            Table II.1.  Adjacencies table.
  307.  
  308. II.1.  Router-router hello
  309.  
  310. For the backbone to create its topology automatically, there must be a
  311. way for routers to discover each other with minimal overhead.  For this
  312. purpose, a router-router hello (RRH) message is provided.  Periodically,
  313. based upon the value of timer "rrhtimer", the router sends out the RRH
  314. message to the subnet multicast address and IP multicast address.  RSPF
  315. makes no assumption of reciprocity (that links are bidirectional);
  316. receipt of an RRH packet provides the receiver with information about a
  317. potential one-way (received) adjacency. 
  318.  
  319. It is noted, however, that while the route testing procedure does not
  320. require reciprocity of subnetworks for "ping" testing, some
  321. implementations will require a successful two-way ARP exchange before
  322. the ICMP Echo packet can be sent.  This often results in some
  323. requirement for reciprocity in practice, even though it is not a
  324. characteristic of RSPF.
  325.  
  326.  
  327. II.2.  Connection-oriented procedure
  328.  
  329. If a router uses connection-oriented subnet procedures on a given
  330. interface, then when a router receives an RRH packet on such an
  331. interface, it checks to see if it already has a link to that packet's
  332. originator in its own **adjacencies table.  If not, and the interface is
  333. of a broadcast nature (reliable or unreliable), it waits a random
  334. period of time (example for AX.25:  within the range of 0 to 10 times
  335. the link's value of T1, DWAIT or SLOTTIME, and in any case much longer
  336. than the timers used within a CSMA or Aloha subnet such as AX.25) and
  337. then attempts to establish a connection in the usual manner.  For
  338. example, in an AX.25 subnet, the router initiates the connection with
  339. SABM; the distant router responds with the usual UA (link established)
  340. or DM (link rejected).  Failure to initiate a connection (i.e., receive
  341. a UA) terminates this procedure; no adjacency is added.  
  342.  
  343. If a two-way connection has been established, then both routers add the
  344. link to their adjacency tables.  While the existence of this route is
  345. set reciprocally, the cost of each side of the route is set separately
  346. for each side of the connection.  Cost is propagated in the routing
  347. update (link state) packet.  Thus the adjacency between two routers is
  348. not actually used for real traffic until the first routing update packet
  349. exchange has taken place.  (This may be useful in dealing with the
  350. situation where a UA is lost during link initiation; procedures for
  351. coping with this known LAP-B problem are for further study.)
  352.  
  353. Loss of an adjacency may then be noted by the loss of the subnet
  354. connection.  When this occurs, the router removes the adjacency from its
  355. adjacency table and follows the "bad news" procedures outlined below for
  356. link state propagation.  (If this cannot be determined by the
  357. implementation, then "ping" procedures as in 1.3.2 below may be useful.)
  358.  
  359.  
  360. II.3.  Connectionless procedure
  361.  
  362. If a router uses connectionless datalink procedures to its own
  363. adjacencies (most suitable to low-loss links such as broadcast-topology
  364. or reliable general-topology subnetworks), then when a router receives
  365. an RRH packet, it checks to see if this adjacency is already in its
  366. adjacency table. 
  367.  
  368. II.3.1.  Acquisition of connectionless adjacencies
  369.  
  370. **In practice, reliable broadcast topology is unusual in the packet
  371. radio arena.  Thus, the acquisition of a new adjacency begins by setting
  372. the link status to "**tentative".  A tentative-state adjacency is tested
  373. by attempting to exchange a packet (ICMP echo) with it, up to a settable
  374. "maxping" number of times.  If successful, the link state is raised to
  375. "good".  If unsuccessful, the adjacency is returned to null, ignored,
  376. and not added to any tables.  **If the destination is already reachable
  377. via a different route, then this prior route should not be discarded; it
  378. should be returned to use if the newly-tested adjacency fails, or if the
  379. new adjacency has a higher cost.  (This may be implemented with a "don't
  380. route" function in IP, bypassing the existing IP route table, passing
  381. normally-hidden subnet information to and from RSPF.)
  382.  
  383. **An alternative to ICMP echo for AX.25 and other broadcast and
  384. semi-broadcast subnets is to directly use ARP to test the adjacency.  In
  385. practice, ICMP will require ARP anyway.  This option raises questions of
  386. layering, but may solve other problems, such as the existence of a prior
  387. IP route when the available IP layer does not support "don't route".
  388.  
  389. II.3.2.  Loss of connectionless adjacencies
  390.  
  391. Loss of an adjacency may be noted by timeout; if no RRH message is
  392. received, and no frames have been received from the adjacent router for
  393. a period of time "suspect timer" (initial suggestion:  slightly over
  394. twice the maximum interval "rrhtimer" between RRH messages), then the
  395. adjacency state becomes "suspect".  The router should attempt (a
  396. settable number of times "maxping") to exchange a packet (ICMP echo)
  397. with the suspect adjacency;  if unsuccessful (after the usual number of
  398. retries), the adjacency is marked "lost".  It may also be marked lost if
  399. other attempts to send data through that router fail, such that the
  400. implementation determines that there is a high probability that the link
  401. is lost.  (However, no obvious means of doing this is noted.  Thus the
  402. "ping" is more likely to be required.)
  403.  
  404. II.3.3.  Link states
  405.  
  406. For purposes of route table generation and link state propagation, a
  407. link whose state is "tentative" or "lost" is "bad";  bad routes are not
  408. used in creating the routing table.  Tentative routes are not
  409. propagated;  newly bad ("lost") routes are propagated by the link state
  410. ("bad news") propagation procedure, and then dropped.  Links whose state
  411. is "good" or "suspect" are used for route table generation and are
  412. propagated.  
  413.  
  414. Note that if a link is connection-oriented, there may be no need for
  415. either a suspect or tentative state; these links are either "good",
  416. "lost", or "null".
  417.  
  418. **Table II-1.  State transition table for adjacencies.
  419.  
  420.    (Null) ----------> Tentative -----------> Good <----\ traffic or
  421.            RRH heard     |   ping succeeds    \  \-----/ RRH heard
  422.                           \                    \
  423.                            \--------->Null      \---| no RRH/tfc heard
  424.                            ping fails  \            v
  425.                                         \<-Lost<---Suspect
  426.                                                ping 
  427.                                                fails
  428.  
  429.  
  430. II.4.  Manual procedure for general-topology subnetworks
  431.  
  432. A general-topology subnetwork may have adjacencies which cannot be
  433. detected by means of a broadcast-oriented (RRH) procedure.  These links
  434. cannot be automatically added, and alternative procedures are required.
  435. These links may be connection-oriented or connectionless; the link state
  436. transition procedure is determined accordingly.
  437.  
  438. The most general way to handle this is to insert these adjacencies
  439. manually.  The state of these adjacencies is determined the same way as
  440. with links that are created by hearing RRH messages.  Note that when an
  441. adjacency is manually-initiated across a general-topology subnet, the
  442. initiating side of the link takes action, while the responding side
  443. should accept the incoming connection request, and both sides see the
  444. link.  Thus only one side of the adjacency actually needs to have a
  445. manual entry.  If a connection already exists to another node across a
  446. subnetwork, then there is no need to initiate a second connection simply
  447. because a manual entry exists.
  448.  
  449. **In some cases (such as source-routed frame relay "digipeating" over
  450. AX.25), a manual route can be entered to a destination whose first hop,
  451. at least, crosses a broadcast-style subnetwork.  This type of adjacency
  452. may require manual intervention in the ARP function as well.
  453.  
  454. II.4.1.  Semi-automatic discovery
  455.  
  456. In addition to manually-created links across a subnetwork, there exist
  457. cases in which the RSPF router is also a subnet router, and is thus
  458. privy to routing exchange information generated by that subnetwork.  (An
  459. example is a node which implements both RSPF and "TheNet".)  If the
  460. subnetwork provides sufficient information such that support of RSPF by
  461. another node can be inferred (i.e., by a distinctive subnetwork
  462. address), then RSPF may sequentially initiate appropriate procedures to
  463. determine whether or not a useful adjacency exists.
  464.  
  465. Translation of routing metrics into an RSPF link metric is handled on a
  466. case-by-case basis.  Specific convergence procedures for any such
  467. subnetwork require further study.
  468.  
  469.  
  470. Table II-2.  Coding of the RRH PDU.
  471.  
  472.                   1           2
  473.  |0              |8              |6              |4              |
  474.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  475.  | RSPF Version #| Type (RRH)    | Checksum                      |
  476.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  477.  |         Full IP Address of sending router                     |
  478.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  479.  |  last packet sent seq. #      |  flags        |
  480.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  481.  |        plaintext                                              |...
  482.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  483.  
  484.  
  485. Parameters--
  486.  
  487.   An RSPF Router-Router Hello packet is sent within IP with a protocol 
  488.   ID of <tbd-- 73 suggested>.  Each RRH packet contains the following
  489.   fields:
  490.  
  491.    RSPF Version Number:  Version number of this protocol "22".
  492. ** This packet format is identical with version 21; RSPF22 should
  493.    accept "21" as valid.  Future versions "30" and above may be
  494.    incompatible.  (Accept anything 2x on receive.)
  495.  
  496.     Type:  Value of 3 for RRH.
  497.  
  498.     Checksum:  IP-style checksum
  499.  
  500.     Address:  Full IP address of sending router
  501.  
  502.     Last packet sent sequence number:  An integer (mod 65536) 
  503.     incremented by 1 for every frame sent by the subnet across 
  504.     this interface.  This value allows receiving entities using 
  505.     connectionless procedures to use the automatic link quality 
  506.     measurement technique described in II.5. 
  507.  
  508.     Flags:  The low-order bit is 1 if connectionless datalink is
  509.     preferred on this interface; 0 if connection-oriented is preferred.
  510.     (Set by system management based upon anticipated link quality.) 
  511.     Other bits are reserved (sent 0; ignored on receive).  Note that
  512.     some implementations do not support this; "preferred" does not
  513.     mean "mandatory".
  514.  
  515.     Plaintext:  An optional text message (length may be up to maximum
  516.     size remaining in datalink PDU).  This might serve, for example,
  517.     to "broadcast" the router's existence to persons who might be
  518.     "reading the mail" (monitoring a radio channel promiscuously).
  519.     **It may be noted that a very short RRH message can be received
  520.     intact across a subnetwork that otherwise might not be capable of
  521.     supporting maximum-size packets with reasonable reliability.  This
  522.     should be taken into account when setting the value of Plaintext.  
  523.     An explicit minimum is not, however, stated.
  524.  
  525.  
  526. II.5.  Automatic link quality measurement
  527.  
  528. (This procedure was not tested in the implementation of RSPF 2.1, and is
  529. therefore considered highly experimental!) 
  530. A connectionless link or subnetwork may have very reliable, or very
  531. sporadic, performance.  Since there is no procedure for ensuring the
  532. reliability of packets sent over a connectionless link, a high rate of
  533. packet loss may occur without being detected by the routers.  If this
  534. loss is high enough, another route may become a better choice; a high
  535. enough packet loss rate may be enough to mark a link as "down".  The
  536. automatic link quality measurement procedure allows links which are not
  537. yet "down", but whose performance is substandard, to be noted.
  538.  
  539. Every router shall maintain, for each link, a count of all packets sent
  540. over each link.  Every time an RRH message is sent, it includes the
  541. current value of this counter (modulo 65536).  Every router also
  542. maintains, in its adjacency table, a count of the total number of
  543. packets received from said adjacency since the last RRH message, and the
  544. value of that counter as received in the last RRH message.
  545.  
  546. Upon receipt of an RRH message, the recipient router compares the value
  547. of the received packet counter with the last received value in the
  548. adjacency table.  The difference (taking into account wrap-around at the
  549. modulus) is compared with the number of packets received since the last
  550. RRH message.  (This works even if an RRH message is lost.)  This packet
  551. loss ratio is then maintained as a guideline to determine link quality.
  552. If link quality falls below a settable threshhold, the link state is
  553. changed to suspect.  Timestamp can also be used to compute packet
  554. arrival rate.
  555.  
  556. Connection-oriented data links presumably deliver 100% of attempted
  557. packets.  A high-quality connectionless link, such as Ethernet/LLC1,
  558. will come close to this.  However, single-frequency packet radio links
  559. are prone to packet loss for several reasons, including hidden
  560. transmitters, lack of collision detection, and rf interference.  The
  561. packet loss ratio is useful in setting link cost, and may also be used
  562. to determine whether a link should use connectionless or
  563. connection-oriented procedures.
  564.  
  565. If a router reports, in its link update packets, that a given link has a
  566. cost of _n_, then its adjacencies (and only its adjacencies) may apply
  567. the packet loss ratio to adjust the cost which they maintain in their
  568. link state tables.  These adjusted costs, rather than the received
  569. costs, may then be propagated to other routers.  
  570.  
  571. Such procedures should be applied sparingly, as each change must be
  572. propagated and could, if used too frequently **or inconsistently across
  573. a network, result in network-wide instability.  A suggested
  574. (experimental) algorithm is as follows:  A percentage threshhold x is
  575. set, as is a cost-adjustment factor y.  If fewer than x% of packets are
  576. received during a measurement interval, the cost of that adjacency is
  577. multipled by y.  For example, if x is 80 and y is 1.5, then an adjacency
  578. with a nominal assigned cost of 4 will be up-costed to 6 if only 70% of
  579. packets are received, but will be restored to 4 if 80% or more are
  580. received during the next measurement interval.  The measurement interval
  581. is the time between RRH messages, which typically should precede routing
  582. update messages.
  583.  
  584.  
  585.  
  586. III. Acquisition of end node adjacencies
  587.  
  588. Four possible means of automatically determining adjacencies to end
  589. nodes are the inclusion of RSPF in end nodes, the use of connected-mode
  590. subnet links, the use of ARP, and the use of a "wiretap" algorithm (see
  591. RFC981).  Unless a connection mode Data Link layer or subnetwork (with
  592. keepalive timers) is used, adjacent nodes may need to send each other
  593. messages at regular intervals (ping) to ensure that the link is still
  594. usable.  A procedure is outlined below for routers and end nodes to
  595. acquire knowledge of each other. 
  596.  
  597. **Adjacencies may also be set manually.  RSPF maintains a manual routes
  598. table which may list both individual nodes and node groups that this
  599. router will route to absent any other information.  (This is required
  600. for creating node group support of end nodes.)  Manual adjacencies are
  601. determined from the manual routes table.  An entry in the manual route
  602. table not flagged as private should be propagated as a known adjacency.
  603. Private entries are not propagated.  **In the event that a private route
  604. provides connectivity to a general-topology subnetwork which notifies
  605. the router of a potential adjacency, this indirect adjacency may be
  606. propagated.  (This latter detail is unproven and may warrant a flag to
  607. disable, on a system or per-manual-route basis.)
  608.  
  609.  
  610. III.1.  RSPF optional in end nodes
  611.  
  612. RSPF need not be activated in end nodes; this permits them to use a
  613. simple version of the TCP/IP software.  A node that has RSPF support in
  614. its software but operates as an end node can also use the router-router
  615. connection procedures and simply broadcast its adjacency to the router
  616. in a one-entry bulletin with a **low horizon.  Such a node may also be
  617. simultaneously homed on two or more other routers, unlike true end nodes
  618. whose traffic either bypasses RSPF (using ARP) or arrives by way of its
  619. associated router.
  620.  
  621. There is no "redirect" function provided in RSPF.  Since radio does not
  622. generally provide a true "broadcast" topology subnetwork, a router
  623. cannot presume that if both end nodes can hear it, that both end nodes
  624. can hear each other.  If an RSPF-equipped end node hears the destination
  625. directly, it may test adjacency to that node, via ARP.  If that
  626. succeeds, then it should choose on its own to route packets there
  627. directly, since that one-hop link on an interface will cost less than a
  628. two-hop link across the same interface.
  629.  
  630.  
  631. III.2  End node subnet connection
  632.  
  633. If an end node knows the IP address of the router which will connect
  634. it to the network at large, it may establish a connected-mode AX.25
  635. or other subnet connection to the router; the presence of this
  636. connection indicates that the node is reachable from that router,
  637. which then adds it to its links table and subsequent bulletins.  This
  638. may, of course, require an ARP exchange in order to acquire the subnet
  639. address (eg., the AX.25 address).  
  640.  
  641.  
  642. III.3.  Connectionless using Address Resolution Protocol
  643.  
  644. Alternately, the end node can simply use ARP and use connectionless 
  645. link procedures. In this case the router should assume that the end node
  646. is available until either a rather lengthy timer expires, or the router
  647. is unable to make an ARP contact after the ARP timer expires.  (A loss
  648. of reachability should not be inferred from the ARP timeout.) 
  649.  
  650. Routers may periodically broadcast their availability (suggested
  651. interval:  every 15 minutes) with a broadcast frame sent to the
  652. broadcast address.  In AX.25, this is a UI frame sent to "QST-0".  A
  653. human-readable ("unproto") message may go here, allowing individual
  654. operators to recognize routers and connect as appropriate.  (No specific
  655. PDU coding is provided, as the end nodes do not use RSPF, and thus this
  656. is not really an RSPF packet.  However, the RRH frame may double for
  657. this function, since its plaintext will generally be readable.)
  658.  
  659.  
  660. III.3.1.  Promiscuous ARP
  661.  
  662. A router may also choose to use "Promiscuous ARP" to provide service to
  663. an end node which is attempting to connect with an IP address reachable
  664. by the router.  In such a case the router should wait an extra interval
  665. after receiving the ARP request because the desired destination may
  666. actually be directly reachable; ARP procedures may need to be modified
  667. to provide this. 
  668.  
  669.  
  670. III.4.  Wiretap
  671.  
  672. Another potential approach is for routers to simply listen to AX.25 
  673. traffic on the link and determine who is adjacent to whom.  This is the 
  674. gist of the "wiretap" algorithm in RFC981, which also finds non-adjacent 
  675. nodes by taking advantage of the source routing found in AX.25 frames.
  676. Integration of wiretap into RSPF is for further study.  (It is not part
  677. of RSPF 2.2.)
  678.  
  679.  
  680.  
  681. IV.  Link state propagation
  682.  
  683. Link state information is propagated between routers within bulletin
  684. envelopes, which are sequences of packets containing partial or full
  685. copies of the sending node's link state table.  Both point-to-point and
  686. broadcast procedures are provided.  
  687.  
  688.  
  689. IV.1.  Optional multicast/broadcast
  690.  
  691. Packet radio is inherently a broadcast medium.  Packet radio networks,
  692. however, do not necessarily offer a reliable broadcast service, even if
  693. they happen to use a broadcast physical medium.  It is still possible to
  694. exploit the broadcast nature of the medium.  RSPF link state propagation
  695. procedures allow but do not require such multicasting.  
  696.  
  697. If the link uses connectionless procedures for user data packet
  698. exchange, then broadcast procedures should be used for link state packet
  699. exchange.  The converse may not necessarily be true:  The threshhold of
  700. loss that militates against connectionless transmission of user data may
  701. be more stringent than that which call for non-broadcast transmission of
  702. link state packets.  Note that RSPF specifically permits its broadcast
  703. procedures to be used over subnetworks that do not have the reliability
  704. of true broadcast-topology subnetworks.  This reduces the channel
  705. utilization on radio links.  
  706.  
  707.  
  708. IV.2.  Routing update bulletins
  709.  
  710. Routing updates are passed along from router to router via routing
  711. update bulletins, which are broadcast within routing update envelopes.
  712. Bulletin propagation is designed to make it highly likely that every
  713. node within a given "horizon" eventually receives every routing update
  714. message sent out by a given node. 
  715.  
  716. IV.2.1.  Sequence numbers
  717.  
  718. Every router originates information about changes in its own
  719. adjacencies, as well as periodic retranmissions of its entire list of
  720. adjacencies.  These bulletins are then propagated among other routers.
  721. The router whose adjacency information is being broadcast is called the
  722. _reporting router_; this may be some hops away from the routers which
  723. forward it to their own adjacencies.  Each reporting router's bulletins
  724. (adjacency updates) contain sequence numbers (and in some cases, a
  725. subsequence number).  These sequence and subsequence numbers are
  726. generated by the reporting router and propagated; they are not changed
  727. when a bulletin is relayed.  They are incrememted by 1 every time a new
  728. one is generated. 
  729.  
  730. IV.2.1.1.  Restored sequence numbers
  731.  
  732. **If RPSF is restarted, after having been run previously run (i.e., in the
  733. event of a system restart) before all knowledge of that router has timed
  734. out of the network, then sequence numbers beginning with 1 could cause
  735. the network to fail to converge, as these bulletins will always appear
  736. obsolete.  A procedure is needed for routers to "catch up" with its
  737. previous sequence number if it is still in the network.
  738.  
  739. **When a router first goes into service, its sequence number is
  740. initialized at 1 (or another low nonzero number).  The router sends RRH
  741. before it sends its first bulletin.  This enables it to first receive an
  742. update from its own adjacencies.  Even if it sends a bulletin before
  743. receiving one from its adjacencies, sending a bulletin with a sequence
  744. number of 1 will prompt the adjacency to update it.
  745.  
  746. Whenever a router receives a bulletin, it examines the contents to see
  747. if its own router number is included as a reporting router.  If so, then
  748. it resets its own sequence number to 1 greater than the sequence number
  749. received.  This enables the router to resume its sequence number
  750. generation at a higher number than where it left off.  A value of 0 is
  751. never used for reporting.  However, a router shall respond to receipt of
  752. a bulletin with a sequence number of 0 with an update containing the
  753. current sequence number.  (The 0 is thus reserved for use as a "poll".)
  754.  
  755. IV.2.1.2.  Sequence number exhaust
  756.  
  757. **Modular (circular) numbers are not used in RPSF Version 2.2.  Thus a
  758. router may eventually exhaust its 16-bit number space, if it is in
  759. continuous operation long enough (nearly two years, given 15-minute
  760. updates).  Should this occur, the router may reinitialize itself by
  761. halting all bulletin origination for a period long enough for the entire
  762. network to "forget" about that router's existence.  Pending further
  763. study, a period of two hours is recommended for RSPF in a typical packet
  764. radio environment.
  765.  
  766. IV.2.2  Subsequence numbers
  767.  
  768. Bulletins may also carry change information incremental to previous
  769. bulletins.  These carry the same sequence number as the full routing
  770. update bulletin to which they are reporting incremental changes; each
  771. such partial routing update bulletin has a subsequence number.  The
  772. subsequence number is zero for a full routing update bulletin.
  773.  
  774. IV.2.3.  Horizon
  775.  
  776. Every bulletin also has a horizon value, set by the reporting router,
  777. associated with each of its constituent links.  (A given reporting
  778. router may have more than one constituent link, if it is a multi-port
  779. router.)  Every time a bulletin is propagated, each horizon value is
  780. decremented by 1.  When it hits zero, the bulletin is not propagated
  781. further.  Note that for horizon purposes, a bulletin's individual
  782. constituent links may have separate horizons; when a link's horizon hits
  783. zero, other links' adjacency information from the same reporting router
  784. may continue to be propogated.  
  785.  
  786. It should also be noted that if a given link has adjacencies with
  787. different horizons, these must be treated as separate links, since
  788. horizon is reported as a characteristic of a link.  Such a circumstance
  789. may occur, for example, when a router serves a node group.  Adjacencies
  790. within the node group are typically propagated with short horizons,
  791. since they are only of local interest (i.e., to other nodes in or near
  792. that node group).  Similarly, the node group itself is propagated with a
  793. long horizon, across a backbone.  However, adjacencies outside the node
  794. group may be propagated with long horizons, as they would not otherwise
  795. be reached across a backbone dependent upon node groups for long-haul
  796. routing.
  797.  
  798. IV.2.4  Routers table 
  799.  
  800. Every router maintains within memory a routers table containing one
  801. tuple for every other router on the network, excepting those which are
  802. unseen because of a horizon.  (An extreme case of this exception is an
  803. end node running RSPF with a horizon of 1, whose existence is only known
  804. to its own adjacencies.)  This tuple contains the following elements:  
  805.  
  806.     IP Address (router number)
  807.     Last received bulletin sequence number 
  808.     Last received bulletin subsequence number 
  809.     Timestamp for when the data was received.  
  810.     Horizon remaining in bulletin when received 
  811.  
  812. This table is used to coordinate the receipt and transmission of
  813. bulletins, using either broadcast or non-broadcast procedures.  **If a
  814. router chooses to use multiple IP addresses (as is commonplace on the
  815. Internet where different interfaces may use different addresses), only
  816. one IP address is used by each router for propagating link state
  817. information.   This is used as the router number.
  818.  
  819.  
  820. IV.3.  Flooding without congestion 
  821.  
  822. A procedure is used to "flood" the network with link state information.
  823. This is designed to minimize the total amount of information
  824. transmitted, while maintaining an up-to-date data base on each router.
  825.  
  826. IV.3.1.  Upon initialization of adjacencies
  827.  
  828. Bulletins are forwarded in a routing update envelope which may contain
  829. one or more reporting routers' bulletins (adjacency lists), which are
  830. flooded to the network.  A bulletin envelope may actually concatenate
  831. multiple reporting routers' bulletins; this is in fact the typical case,
  832. when routing update packets are exchanged on schedule, and when a given
  833. router acquires a new adjacency.  However, partial routing updates (good
  834. news and bad news) may be sent at any time.
  835.  
  836. The first time an adjacency is acquired, the two routers perform a full
  837. routing update with each other, exchanging their complete link lists.
  838. Once this is complete, the routers perform the SPF algorithm and compute
  839. new routing tables.
  840.  
  841. IV.3.2.  Preventing loops and retransmissions
  842.  
  843. A bulletin from reporting router X (which lists all of X's adjacencies)
  844. is sent, initially by X, to every adjacent (to X) router A.  This router
  845. A passes it along to all of its own adjacencies B, etc.  This flooding
  846. is controlled such that no reporting router's adjacency update is sent
  847. more than once between the same pair of routers.  
  848.  
  849. After router A sends its bulletin envelope to B, the recipient router B
  850. then looks at the sequence number of each reporting router X's adjacency
  851. bulletin within that envelope, and for each reporting router's bulletin,
  852. compares the sequence number of the just-received adjacency bulletin
  853. with the highest sequence number previously originated from X.  If the
  854. just-received bulletin is newer (higher number), then it [**for further
  855. study: sends a positive acknowledgement to A, and] joins in the flooding
  856. to its own adjacencies.  The horizon is, of course, decremented. 
  857.  
  858. If the bulletin from X has the same number as was stored in B, B checks
  859. the horizon left in the received bulletin against the horizon left when
  860. it previously received the bulletin.  In the event that the latest
  861. bulletin received had a shorter (lower number) horizon left than the
  862. earlier one, it simply ignores [and acknowledges] the (redundant)
  863. message.  But if the reporting router X's horizon left is greater for
  864. the new copy of the bulletin, router B propagates it as if it were a new
  865. bulletin. This way, if the bulletin happened to first arrive via a
  866. roundabout path, it won't accidentally fail to reach the intended end of
  867. its range. (Summary:  Newer or longer-horizon bulletins are both passed
  868. along.  Same age or older (by sequence number) or same or lower horizon
  869. will not be propagated.)
  870.  
  871. If any router B receives from router A a bulletin (from any reporting
  872. router X) that contains a lower sequence number than one that had
  873. previously arrived at B from said X, then it can be presumed that A has
  874. "obsolete" information.  B replies by sending a bulletin to A with the
  875. latest link state information for that node X.  As a corollary, a router
  876. may poll for information about a given reporting router by sending a
  877. routing update bulletin for that reporting router with a sequence number
  878. **of 0.  Said bulletin may contain zero links' information.  
  879.  
  880.  
  881. IV.4.  Point-to-point bulletin envelope exchange
  882.  
  883. A router may acquire routing information from adjacent routers via
  884. point-to-point procedures which treat every adjacency as a separate
  885. logical data link.  (Such a procedure also works, of course, over
  886. point-to-point links such as wirelines.)  This tends to have the highest
  887. reliability, since connection-oriented data link control procedures can
  888. be used to ensure the accuracy and completeness of the data passed over
  889. the link.  It has the disadvantage of requiring separate transmission of
  890. the same data to different adjacent nodes on the same radio channel. 
  891.  
  892. Bulletin envelopes are thus exchanged (when connection-oriented is
  893. selected) periodically (based upon timers) and when new information is
  894. received (over a new adjacency, and when good and bad news arrive).
  895. Delivery of these bulletins is considered to be generally reliable.
  896.  
  897.  
  898. IV.5.  Broadcast bulletin propagation
  899.  
  900. When a router is adjacent to several other routers via the same
  901. broadcast (i.e., packet radio) channel, retransmission of routing
  902. bulletins to each adjacency makes additional use of bandwidth, which may
  903. be a scarce resource.  A broadcast procedure may be used to pass the
  904. bulletin along that link.  Note that broadcast propagation of bulletins
  905. may be combined with non-broadcast propagation, on a link by link basis.
  906. Although packet radio is a broadcast medium, it is not a perfect one:
  907. The reliability of multicast packets is not as high as for wireline
  908. LANs.  This leads to the need for a unique broadcast "flooding"
  909. technique.  Note that in a true broadcast-topology subnetwork, these
  910. procedures add little channel overhead, so these procedures are
  911. applicable there as well.
  912.  
  913. IV.5.1.  AX.25 subnetworks
  914.  
  915. **At this time, only the AX.25 subnetwork is widely used in AMPRnet
  916. while providing a multicast/broadcast service.  Similar procedures may
  917. be adapted for use elsewhere.
  918.  
  919. A routing update bulletin is broadcast to the Layer 2 multicast AX.25
  920. address using the IP multicast address.  Individual recipient routers
  921. may or may not receive the entire bulletin, since there is no
  922. acknowledgement provided. 
  923.  
  924. In the previously described case of a non-broadcast message sent via a
  925. connection-oriented datalink, the entire routing update bulletin can
  926. be assumed to have been received intact.  Thus, if a given reporting
  927. router has originated a new complete list of its adjacencies (new
  928. sequence numbers, subsequence numbers are 0), then any adjacency not
  929. included is presumed to have ceased to exist.  Such a presumption is
  930. not always possible when a bulletin was received via unacknowledged
  931. broadcast, as the message might have been received in part.  This
  932. should not make the partially received bulletin unusable. 
  933.  
  934. A bulletin envelope is transmitted in one or more packets, each of
  935. which constitutes a numbered fragment of the whole bulletin envelope.
  936. Within the transmitted bulletin envelope, each individual reporting
  937. router's bulletin begins with a node-header which contains the number
  938. of links being reported on.  Within each bulletin, each link is
  939. identified by a link header, each of which specifies the number of
  940. adjacencies being reported on (for that link).  Since each IP packet
  941. that makes up a bulletin contains a fragment number, it is also
  942. possible to determine whether or not a fragment was lost.  Each packet
  943. also contains an envelope-ID, which prevents accidental mis-assembly
  944. of different bulletins that may arrive close in time. 
  945.  
  946. In connection-oriented non-broadcast procedures, a routing update 
  947. bulletin (not a partial one with a subsequence numbers >0) provides a 
  948. complete list of adjacencies known to the sending node, except where the 
  949. horizon is exceeded.  Absence of a previouly-known adjacency then 
  950. implies that the adjacency has been lost.  However, that assumption does 
  951. not apply to fragmented bulletins received in part, which can occur with 
  952. broadcast procedures: If a fragment was lost before reaching the end of
  953. a given reporting router's bulletin within the bulletin envelope, then
  954. the absence of a previously-known adjacency in the received bulletin
  955. does not mean that the adjacency was lost. 
  956.  
  957. RSPF procedures dictate that routing update bulletins with a subsequence 
  958. number of zero are presumed to be complete lists of adjacencies from 
  959. their originators; higher subsequence numbers represent incremental
  960. changes only.  In the broadcast procedures, a routing update bulletin 
  961. with a subsequence number of zero, if received only in part, is
  962. treated as a partial routing update bulletin.  If it received in full,
  963. it is treated as a full routing update bulletin.
  964.  
  965. Thus, the recipient compares the sequence number with the previously
  966. received sequence number from that reporting router.  If it is higher
  967. than the previously received one, then its adjacencies are used.  If
  968. it was received in full, and had a subsequence number of 0, then its
  969. previous adjacencies are replaced (removed if not contained in the
  970. latest full routing update bulletin).  If it was not received in full,
  971. or if its subsequence number was not zero, then its previous adjacencies
  972. are left intact unless explicitly changed by the received bulletin.
  973.  
  974. If a bulletin is received in full, then the routers table is updated 
  975. with the latest sequence and/or subsequence number, horizon, and
  976. timestamp.  If it is received in part, then these entries are not
  977. updated.  After the bulletin has been completely transmitted, a
  978. recipient node which has received a partial update from a reporting node
  979. may poll for that node's latest information, by **originating a bulletin
  980. naming the reporting router in question, specifying sequence number 0,
  981. with zero links for that reporting router.  (This is the same polling
  982. procedure used for non-broadcast links.)  
  983.  
  984. Note that if a fragment is lost, a reporting router whose node-header is 
  985. in the lost fragment will of course remain unchanged in the recipient's 
  986. data base.  Furthermore, any data received in subsequent fragments, 
  987. prior to a node-header, will also be meaningless.  The last adjacency 
  988. of the last link in a reporting router's bulletin will have the Last 
  989. flag set to 1, signaling that following the address, a node header 
  990. follows.  Note also that the first node-header within an envelope is
  991. pointed to by the sync byte in the envelope header.  The last flag and
  992. sync byte should match or an error should be noted.
  993.  
  994. **IV.5.2.  Reconstructing bulletins from multiple fragments
  995.  
  996. If the resent bulletin is the same one as previously received in part,
  997. and it too is received in part, then if all of the previously received
  998. fragments were stored, the receiving router may attempt to reconstruct
  999. the entire bulletin from the two (or more) fragmented transmissions.
  1000. Once an entire bulletin has been reconstructed, the receiving router may
  1001. treat this as a complete update.  (This procedure is optional.)
  1002.  
  1003. **IV.5.3.  Non-broadcast unreliable subnets
  1004.  
  1005. If an adjacency is established across a general-topology subnet that
  1006. does not offer reliable packet delivery (eg., TheNet packet level), then
  1007. broadcast procedures should be used to exchange routing information
  1008. across the subnet between the two adjacencies.  If the entire bulletin
  1009. is received intact, then it should be used; if it is received in part,
  1010. the received portions may be used, and the recipient may poll for a
  1011. retransmission as in IV.5.1 and IV.5.2 above.
  1012.  
  1013.  
  1014. IV.6.  Routing update bulletin packets 
  1015.  
  1016. A routing update bulletin envelope (Table IV.1) may contain several
  1017. different reporting routers' updated link state information,
  1018. concatenated into one message, with a different sequence number for each
  1019. source (reporting router).  One of the sources, of course, may be the
  1020. local router.  Each router's link state information is further broken
  1021. down by link, which allows its backbone routing information to be
  1022. propogated separately from its local end node adjacency information. 
  1023.  
  1024. IV.6.1.  Node group reduction of adjacency list
  1025.  
  1026. If an end node establishes a connection with a router whose node group
  1027. default addresses (based on the significant bit count) already include
  1028. that end station, no bulletin need mention that adjacency, as packets to
  1029. that end station will already be routed correctly.  Node groups are
  1030. defined manually.
  1031.  
  1032. IV.6.2.  Incremental changes (good news and bad news)
  1033.  
  1034. Bulletins that only report changes in state come in two flavors.  Good
  1035. news bulletins inform other routers that an adjacency has been noted.
  1036. bad news bulletins inform them that an adjacency has been lost.
  1037. Theoretically, a router could send out a new full routing update
  1038. bulletin every time it gained or lost an adjacency. However, the use of
  1039. shorter good news and bad news packets, which do not contain a full
  1040. routing update, allow the network to remain relatively current with less
  1041. transmitted traffic. 
  1042.  
  1043. Good news and bad news packets are propogated like other packets, but
  1044. are not originated by the same rules.  While full routing bulletins are
  1045. originated based upon a timer (rspftimer), good news packets are
  1046. transmitted immediately upon receipt and initiated immediately after an
  1047. adjacency is initialized.  This enables new links to be useful quickly.
  1048. Bad news, however, should not travel as fast:  A node should cache any
  1049. bad news message for a time (**recommendation for this timer:
  1050. rspftimer/16) while waiting for the link to come back up.  This helps
  1051. keep the network stable; if the node receives a packet destined for the
  1052. lost destination, it may send an ICMP "host unreachable" message to the
  1053. originator of the packet, unless it can reroute the packet itself (as
  1054. may happen with the loss of a backbone link when others still exist).
  1055.  
  1056. Because good news and bad news messages represent changes to the last
  1057. full link state bulletin propogated, but do not purport to completely
  1058. represent a node's link states, they carry bulletin subsequence
  1059. numbers.  These use the last bulletin sequence number originated by the
  1060. reporting router, but the sub-sequence value increments from 1. (A full 
  1061. link state packet has a sub-sequence value of 0, and resets the 
  1062. subsequence counter.) 
  1063.  
  1064. IV.6.3.  Routes to nearby destinations
  1065.  
  1066. Sometimes more than one router will serve the same area (determined by 
  1067. the significant bits' matching), and they will need to know which one has 
  1068. the better path to a given station.  These adjacency messages may only 
  1069. require a short horizon, as will good news and bad news packets which 
  1070. refer to end nodes going on and off the air.   Higher horizons are 
  1071. needed for backbone routers. 
  1072.  
  1073. **This distinction allows routers to define their service area and role
  1074. within a network by appropriate horizon adjustment.  A router that only
  1075. uses short horizons may be useful for providing connectivity within a
  1076. constrained geographic area, typically encompassing one or a small
  1077. number of node groups, in which not all end users have full connectivity
  1078. to a single router.  Such a router will set its horizon_link, reporting
  1079. on other routers, to a low value.  A router that serves as a backbone
  1080. node, propagating node groups across a wider horizon, will have a high
  1081. horizon_group, reporting node groups, value.  (**Horizon_link and
  1082. horizon_group values are usually set the same.  Horizon_portable is
  1083. usually set to the same value as horizon_group and horizon_link;
  1084. horizon_local is set to a low value, so that even a backbone router will
  1085. not propagate intra-node group information across the backbone.)
  1086.  
  1087.  
  1088. Table IV.1.  Routing update (link state packet) bulletin envelope:
  1089.  
  1090.                   1           2
  1091.  |0              |8              |6              |4              |
  1092.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
  1093.  | RSPF Version #| Type          | fragment #    | fragment total| packet
  1094.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -hdr
  1095.  |       Checksum                | sync byte     | # nodes below |
  1096.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  1097.  |  Envelope-ID                  |
  1098.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
  1099.  |         Reporting node #1 full IP Router-Address              | node
  1100.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -hdr
  1101.  |  Node 1 bulletin  sequence #  | sub-sequence #| # links       |
  1102.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
  1103.  | horizon left   |  ERP factor  |  link cost    |  #adjacencies | link
  1104.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ _-hdr_
  1105.  |significant bits|
  1106.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1107.  |              Adjacent node(s) 1,1,1 IP address                | adj.
  1108.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1109.  |significant bits|
  1110.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1111.  |             Adjacent node(s) 1,1,2 IP address                 | adj.
  1112.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1113.                        ...
  1114.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1115.  |significant bits|
  1116.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1117.  |             Adjacent node(s) 1,1,n IP address                 |
  1118.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1119.  | horizon left   |  ERP factor  |  link cost    |  #adjacencies | link
  1120.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1121.  |significant bits|
  1122.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1123.  |             Adjacent node(s) 1,2,1 IP address                 | adj.
  1124.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1125.                         ...
  1126.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1127.  |significant bits|
  1128.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1129.  |             Adjacent node(s) 1,2,n IP address                 | adj.
  1130.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1131.  |         Reporting node #2 full IP Address                     | node
  1132.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1133.  |  Node 2 bulletin sequence #   | sub-sequence #|  # links      |
  1134.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1135.  | horizon left  |  ERP factor   |  link cost    |  #adjacencies | link
  1136.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1137.  |significant bits|
  1138.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ adj.
  1139.  |             Adjacent node(s) 2,1,1 IP address                 |
  1140.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  1141.  |significant bits|
  1142.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1143.  |             Adjacent node(s) 2,1,2 IP address                 |
  1144.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1145.                        ...
  1146.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1147.  | horizon left    |  ERP factor |  link cost    |  #adjacencies | 
  1148.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1149.  |significant bits|
  1150.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1151.  |             Adjacent node(s) 2,2,1 IP address                 |
  1152.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1153.                         ...
  1154.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1155.  |significant bits|
  1156.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1157.  |             Adjacent node(s) 2,2,n IP address                 |
  1158.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1159.                         ...
  1160.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1161.  |         Reporting node #n full IP address                     |
  1162.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1163.  |  Node n bulletin sequence #   | sub-sequence #|   # links     |
  1164.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1165.     etc.
  1166.  
  1167. Parameters--
  1168.  
  1169.   An RSPF bulletin packet is sent within IP with a type of <tbd - use 73
  1170.   until an official value is assigned>.  Each routing update envelope
  1171.   contains an envelope packet header that contains:
  1172.  
  1173.     RSPF Version Number:  Version number of the protocol (22).
  1174.  
  1175.     Type:  (Value 1 for Routing Update Bulletin Envelope)
  1176.  
  1177.     Fragment Number:  States which fragment, in a segmented message,
  1178.     this is, beginning at 1.  Non-fragmented messages use 1.
  1179.     
  1180.     Fragment total:  Total number of fragments in message; 1 if not 
  1181.     fragmented.
  1182.  
  1183.     Checksum:  IP-style checksum.
  1184.  
  1185.     Sync byte:  Which octet in this packet (counting from this 
  1186.     byte as byte 0) is the beginning of the first node-header.  If 0,
  1187.     this fragment has no node-header.  Non-fragmented messages
  1188.     use a value of 4 (because 3 bytes follow in packet header).
  1189.  
  1190.     Number of nodes reporting:  The number of reporting routers in the 
  1191.     messages that follows (this packet or a sequence of packets forming
  1192.     the envelope).
  1193.  
  1194.  
  1195.   The node-header (for each reporting router) contains 8 octets:
  1196.  
  1197.     Reporting router #n full IP router address:  The IP address of 
  1198.     the router whose adjacencies are being reported below.  (Note
  1199.     that if a router uses separate IP addresses on its links, it
  1200.     should still adopt a single one as its router address.)
  1201.  
  1202.     Bulletin sequence number:  When a bulletin is passed along, this 
  1203.     number is NOT changed; every new bulletin from a given Reporting 
  1204.     router has a value 1 higher than the previous bulletin from that
  1205.     reporting router.  
  1206.     
  1207.     Sub-sequence number:  Good news and bad news packets representing
  1208.     incremental changes from the last full report increment this value
  1209.     by 1; it is 0 for full bulletins.
  1210.  
  1211.     # links:  The number of different cost-horizon values (typically, 
  1212.     but not necessarily, representing different types of link in a 
  1213.     mulitiport gateway) being reported below; the following four octets 
  1214.     are the header for each link.
  1215.  
  1216.  [For each reporting router, adjacencies are reported separately by
  1217.   link cost.  This is the received cost value for that data link, after
  1218.   any adjustment that may be based upon packet loss ratio.  Adjacencies
  1219.   are also reported separately by horizon, even if the cost is the same. 
  1220.   It does not matter at this point if there are multiple RF or other 
  1221.   links if their cost and horizon are the same.  Likewise, separate
  1222.   received costs or horizons on one link will be treated separately
  1223.   and such adjacencies will be grouped under separate link headers:]
  1224.  
  1225.     Horizon left:  This number is decremented every time a routing update 
  1226.     bulletin is passed along; when it reaches 0, it is not passed further.
  1227.  
  1228.     Link cost:  A "figure of merit" for each link, rising with
  1229.     slower/poorer links.  This is the number whose total is minimized
  1230.     by SPF.  The range is 1-127.  As a starting point, a 56000 bps fdx
  1231.     backbone link might have a value of 2, a 4800bps hdx link a value
  1232.     of 5, a 1200bps hdx link a value of 10 and a 300 bps hf "wormhole"
  1233.     a value of 20.  An Ethernet or high-speed (1 Mbps+) link might
  1234.     then have a value of 1.  A value of 255 denotes the loss of a
  1235.     link; this is found in Bad News packets.  These values should be
  1236.     coordinated network-wide;  adjusting them will change the way
  1237.     packets are routed by RSPF.
  1238.  
  1239.     Number of adjacencies:  The number of adjacencies to be listed for that 
  1240.     reporting node.
  1241.  
  1242.     ERP Factor:  Used for "approximating" a route; contains the number of 
  1243.     significant bits for which a given node can be presumed to be a valid 
  1244.     router, even if it doesn't report in detail.  A low factor = wider 
  1245.     coverage area; thus ERP of 16 means that if NO other match is found for 
  1246.     a given address, this router will try to handle it if it matches 16 
  1247.     bits.  Basically a handle for future enhancements; its use will not
  1248.     be required in this release of RSPF.
  1249.  
  1250.   For each adjacency of the given link cost, the following is provided:
  1251.  
  1252.     Significant bits: The number of bits used for node group routing 
  1253.     purposes.  Usually 32 but may be lower if a given link purports to 
  1254.     serve all end nodes in an area defined using the most-matched-bits 
  1255.     node group convention.  Higher numbers of bits matched take a higher 
  1256.     priority than least cost.  This uses the low-order 5 bits of the 
  1257.     octet.
  1258.  
  1259.     Last-flag:  If this is the last adjacency in the list for this 
  1260.     reporting router, this value is 1; otherwise it is 0.  (This 
  1261.     occupies the high-order bit of the significant bits octet.)
  1262.  
  1263.     Full IP address: The full IP address for this node.  
  1264.  
  1265. Note that the n,n,n vector within the bulletin has three fields in the
  1266. above representation: Reporting router within bulletin envelope, link 
  1267. cost/horizon within reporting router's bulletin, and reporting adjacency
  1268. with that link cost/horizon.
  1269.  
  1270.  
  1271. IV.7.  Fragmentation
  1272.  
  1273. In a moderate to large network, a full routing update can easily exceed 
  1274. the maximum size of an AX.25 frame or IP packet.  The RSPF Routing
  1275. Update message, however, may be sent in fragments.  The IP fragmentation
  1276. function is not used for this; bulletins are not assumed to be
  1277. terminated by a packet boundary.  Each fragment is, however, numbered in
  1278. the packet header, along with an indication of the number of the total
  1279. number of fragments in that envelope.
  1280.  
  1281. In order to permit parsing of the incoming fragments by routers who
  1282. are using unacknowledged broadcast information (with the high 
  1283. likelihood of lost fragments), every bulletin's packet header contains a 
  1284. sync byte indicator.  This indicates which byte, where the next byte in 
  1285. the header is byte 1, is the beginning of a node header.  If a previous 
  1286. fragment was lost, the receiver should ignore the number of bytes 
  1287. indicated in the sync byte before resuming parsing of the packet.  (If 
  1288. the fragment does not exceed 255 bytes, this will always be sufficient.  
  1289. It is recognized that long packets may not be able to use this mechanism 
  1290. reliably, and a value of "0" should be used to indicate that no sync is 
  1291. possible within this fragment.)
  1292.  
  1293. Each routing update bulletin envelope takes the form of a three-
  1294. dimensional list, with the dimensions being reporting router, link and
  1295. adjacency. A given bulletin envelope may report on link state from one
  1296. or more remote nodes, as well as from the sending node.  Each node may
  1297. have one or more links; each link may have one or more adjacencies. 
  1298.  
  1299. Packets may not be fragmented within adjacencies, but may be
  1300. fragmented after an adjacency's address and before the next adjacency's
  1301. significant bits field.  (This presents a 5-octet field that should
  1302. not be fragmented.)  The next fragment, in a new packet, simply begins
  1303. where the last one left off; the receiver knows how much more to
  1304. expect based upon the node and link count in the respective
  1305. node-header and link-header. 
  1306.  
  1307. A router may not start sending a new Routing Update message of any kind 
  1308. to any given IP address until all fragments of a previous message to
  1309. that address have been transmitted.  This applies both to point to
  1310. point (non-multicast address) and multicast procedures.
  1311.  
  1312.  
  1313. IV.8.  Bulletin Timers
  1314.  
  1315. The timers used for bulletin updates must be a compromise between
  1316. maintaing the network's current state and the traffic required to do
  1317. so.  An initial suggestion:  Good news messages should be initiated
  1318. within a few seconds and bad news should wait at least **rspftimer/16,
  1319. with relatively short horizons on the bulletins (i.e., the routers
  1320. within the region).  Full routing updates with normal horizons should be
  1321. sent out every rspftimer interval (typically 30 minutes).  If the
  1322. network is small, more frequent updates may be possible; too frequent
  1323. updates risk choking the network with update traffic.
  1324.  
  1325.  
  1326.  
  1327. V.  The Shortest Path First spanning tree algorithm
  1328.  
  1329. As a routing node comes onto the network, it acquires over time a
  1330. complete list of adjacencies between other nodes on the network except
  1331. as limited by the "horizon".  Each adjacency (point to point link)
  1332. within the entire known network has a "cost" associated with it.  It
  1333. should be noted that adjacencies, for the purposes of this algorithm,
  1334. are "logical" and not necessarily physical;  if a subnetwork link
  1335. occurs below IP (as in AX.25 digipieating or TheNet), the two ends of
  1336. the link are still adjacent.  (Adjacency at the IP internet layer is
  1337. based upon subnetworks, which may contain their own links.)  
  1338.  
  1339. Cost is set for the receive side of each link.  If the receiver and
  1340. transmitter do not agree on cost, the network shall apply different
  1341. routes for packets going in opposite directions between the same two
  1342. end nodes.  (This is not a problem.  In a radio environment, one
  1343. should NOT assume reciprocity across a link.) 
  1344.  
  1345.  
  1346. V.1.  Tables
  1347.  
  1348. V.1.1.  Link State Table
  1349.  
  1350. Each router builds a _link state table_ (or links table) that lists, for
  1351. every known link in the network (from every reporting router), the two
  1352. ends and the cost of that end of the link.  The ends are listed by an IP
  1353. router address and, for the destination IP router address, a number of
  1354. significant bits.  This is what is updated by the bulletins and by good
  1355. news/bad news messages.  Adjacent links also are merged in from the
  1356. adjacencies table.
  1357.  
  1358.     Source IP address    Dest. IP addr/bits    Cost
  1359.  
  1360.     44.56.4.44        44.56.4.128/32        5
  1361.     44.56.4.44        44.56.4.12/25        10
  1362.  
  1363. V.1.2.  Paths table
  1364.  
  1365. The goal of the SPF algorithm within RSPF is to build a _paths table_
  1366. which lists, for every reachable node (or node group approximation of
  1367. fewer than 32 bits) on the network, that node address (or node group
  1368. address and number of significant bits), the adjacent node used to get
  1369. there (i.e., where you blast the packets to next), and the total cost of
  1370. the path.  This is done by building a spanning tree with the router doing
  1371. the computation (the home router) as the root of the tree.  The paths
  1372. table thus lists the best way across the tree from the home router to all
  1373. known destinations.
  1374.  
  1375. V.1.2.1.  Route table
  1376.  
  1377. **It should be noted that the only implementation of RSPF to date is
  1378. within the KA9Q NOS package.  This includes a route table which roughly
  1379. corresponds to the paths table, trusting ARP to provide subnetwork
  1380. information.  However, RSPF routing makes nominal use of a logical route
  1381. table which includes both the paths table entries and the subnetwork
  1382. address required to reach the first adjacency.  The structure of this
  1383. table's implementation need not be defined here.  It may, for example, be
  1384. a logical union of the paths table relation (providing IP addresses) with
  1385. ARP and related subnetwork table relations, using IP address as the
  1386. common key.  (Thus there is no RSPF route table per se.  This corresponds
  1387. to the logical route table in RSPF 2.1.) Or RSPF may supersede these
  1388. tables with a separate route table including required hardware and
  1389. subnetwork address information.
  1390.  
  1391. Entries in the route table include: 
  1392.  
  1393.         Destination IP Address
  1394.         Destination IP Address number of bits (0-32)
  1395.         Selected adjacency hardware interface
  1396.         Selected adjacency subnetwork address string
  1397.         Adjacency IP address
  1398.         Cost  
  1399.  
  1400. V.1.3.  Trial table
  1401.  
  1402. Every router contains, for the purposes of building the tree, a 
  1403. _trial table_ that has three entries:  Destination address/bits,
  1404. adjacent node, and cost of this path.  The paths table additionally 
  1405. has one more entry, the _parent_ node, which is the last hop
  1406. before the destination.  Thus in a path A -> B -> C -> D -> E, home 
  1407. router A views E as the destination, D as the parent, and B as the
  1408. adjacency.  Note that in the path from A to B, A is the parent node. 
  1409.  
  1410. V.2.  Building the paths table
  1411.  
  1412. Begin building the paths table by using the home router as the first 
  1413. node on the paths table.  The cost to reach yourself is always 0, so 
  1414. make the first entry on the paths table as follows:  Source=self,
  1415. destination=self, parent=self, and cost=0.  From here on in, parent 
  1416. is always (by definition of the SPF spanning tree) the node most 
  1417. recently added to the paths table.
  1418.  
  1419.     Destination    Adjacent     Parent        Cost
  1420.  
  1421.     44.56.0.128    44.56.0.128    44.56.4.44    5
  1422.     44.56.0.131    44.56.0.128    44.56.0.128    10
  1423.     44.56.0.200    44.56.0.128    44.56.0.131    15
  1424.  
  1425.         Paths Table showing relationship between 
  1426.     destination, parent and adjacent nodes, where the home
  1427.     node is 44.56.4.44 and 44.56.0.200 is three hops away;
  1428.     all hops here have a cost of 5.
  1429.  
  1430.  
  1431. V.2.1.  Scanning the links
  1432.  
  1433. The home router now scans its links table looking for all nodes (routers 
  1434. and end nodes) that are adjacent to the current parent node, except
  1435. for links to nodes which are already on the paths table.  (It is
  1436. generally fastest to build the paths table by scanning the links table
  1437. in order of increasing link cost.)  Each of these new nodes is added
  1438. to the trial table, except for the parent node (which is already on
  1439. the paths table, so it can't possibly have a shorter path).  The value
  1440. of cost placed on the trial table is the cost of the link from the
  1441. parent to the destination plus the cost from home to the parent node
  1442. (which value is already on the paths table).  
  1443.  
  1444. A node may only appear once in the trial table at any given time.  If
  1445. an adjacency is found to a node that is already on the trial table, a
  1446. new entry replaces the existing entry if and only if the new total
  1447. cost is lower.  If the cost is higher, it is ignored.  (If the costs
  1448. are equal, then a "tiebreaker" is determined by treating the
  1449. lower-numbered IP address as the lower cost.  This will simply make
  1450. the spanning tree more deterministic in case of tie.)  Thus the trial
  1451. table always contains the lowest cost path to each destination found so
  1452. far.
  1453.  
  1454. Once all of the links from the parent node have had their chance to go 
  1455. onto the trial table, scan the entire trial table for the _one_ entry
  1456. with the lowest total cost.  This not need be a link from that parent
  1457. node!  In case of tie, pick the lower IP address (again just to be
  1458. deterministic).  Move this node to the paths table;  guaranteed,
  1459. there'll be no cheaper path to that node!  The adjacency used for that
  1460. node in the paths table is the adjacency to its parent node.  Note
  1461. that the parent _must_ already be on the paths table since that's the
  1462. source of the parent; you're working your way outward. 
  1463.  
  1464. This new addition to the paths table becomes the new parent node.  Repeat
  1465. the procedure above (from the beginning of V.2.1) until there are no
  1466. nodes left on the trial table.  This means you've completed the spanning
  1467. tree and have found the least-cost path to every other node.
  1468.  
  1469. One of the router parameters is maximum_cost.  If the cost to a given
  1470. parent node exceeds this value, the procedure stops, since all subsequent
  1471. entries in the route table will have a higher cost.  This value has some
  1472. semblane to the time-to-live parameter of the IP packet:  It makes little
  1473. sense to compute a routing table to nodes that cannot be reached within
  1474. time-to-live.  (Ideally, ttl will be implemented using a timer rather
  1475. than a node counter, but this is difficult to do with some of the packet
  1476. radio data link controller implementations; vis., TNCs.)
  1477.  
  1478. A router should recalculate its routes periodically based upon the 
  1479. current links table.  How frequently depends upon the CPU load involved.
  1480. Initial estimates are that it should be recalculated after receipt of
  1481. every routing update bulletin:  Partial calculations do not save
  1482. enough CPU time to make them worthwhile.
  1483.  
  1484.  
  1485. V.3.  Filling in the routing table 
  1486.  
  1487. **The route table in NOS (the KA9Q et al implementations of IP)
  1488. contains, for each entry, the destination address, number of bits,
  1489. interface, gateway and metric.  RSPF 2.2 conceptually replaces this with
  1490. a manual route table (essentially what exists in NOS without RSPF) and a
  1491. route table which RSPF generates itself; when RSPF is activated, this
  1492. latter table is used for packet routing.
  1493.  
  1494. **The route table is filled in from the paths table after each time the
  1495. SPF algorithm has finished.  It takes entries from both the paths table
  1496. and the manual route table.  Order of precedence is important here.
  1497. Manual routes have lower precedence than routes taken from the paths
  1498. table, given an equal cost, but a lower cost manual route will override a
  1499. higher-cost paths table entry.
  1500.  
  1501. Since the routing table will be periodically recalculated from
  1502. scratch, implementation **requires two separate route tables, one "in
  1503. progress" and one "in service".  When the route calculation is
  1504. complete, the "in progress" table becomes "in service" and the old one
  1505. is cleared for reuse.  This allows packet forwarding to continue while
  1506. the completed paths table is being converted into the route table.
  1507. **Calculation of the paths table and route table can require substantial
  1508. CPU resources, and should not take precedence over packet forwarding.
  1509.  
  1510.  
  1511. V.4.  Manual routes
  1512.  
  1513. A manual route table may also be maintained.  This takes second
  1514. precedence to RSPF-generated entries in generating the route table.
  1515. Manual routes are useful defaults before RSPF generates routing entries,
  1516. for destinations not reported on by RSPF, for creating node group
  1517. adjacencies, and for interworking with other routing protocols.  **Note
  1518. that manual routes in RSPF 2.2 are (at least logically) not simply
  1519. entries in the initial routing table, but are permanent (until changed
  1520. manually) entries in a separate manual route table which is merged into
  1521. the RSPF-generated route table as the last stage of each calculation of
  1522. the route table.  (As an implementation option, the manual route table
  1523. could conceivably be interleaved with the route table, with a "manual"
  1524. flag on these entries, but the manual entries behave differently.)
  1525.  
  1526. **Note that all manual routes are considered as adjacencies.  This is
  1527. obviously wrong at times, but cannot be determined automatically.  Thus
  1528. the private flag is provided.
  1529.  
  1530. Entries in the manual route table include: 
  1531.  
  1532.         Destination IP Address
  1533.         Destination IP Address number of bits (0-32)
  1534.         Selected adjacency hardware interface
  1535.         Selected adjacency subnetwork address string
  1536.         Adjacency IP address
  1537.         Cost
  1538.         Flag:  Private/non-private
  1539.  
  1540.  
  1541. V.4.1.  Private routes
  1542.  
  1543. Any manual route may be flagged as private.  These routes are used in
  1544. calculating the route table, but are never propagated to other nodes.
  1545. Default routes should always be defined as private, as they do not denote
  1546. known adjacencies, only values that this node will use absent better
  1547. information.  
  1548.  
  1549.  
  1550. **V.5.  Secondary storage of routing information
  1551.  
  1552. This section is for study.  It may be unnecessary because adjacencies
  1553. will provide a full report to a router upon initialization of an
  1554. adjacency.
  1555.  
  1556. Real implementations of RSPF, especially under single-tasking operating
  1557. systems (such as MS/PC/DR-DOS), will not always run continuously without
  1558. interruption.  Nor will all end systems.  When RPSF starts running, it
  1559. has an empty links table, and depends upon manual routes until receiving
  1560. links information from its adjacencies.  On a packet radio network,
  1561. given the low bandwidths, this convergence may take excessively long.  
  1562.  
  1563. An implementation may work around this by storing, in non-volatile media
  1564. (eg., hard disk) the information needed to quickly resume operation.
  1565. This file (whose internal format is a local matter) should contain a
  1566. timestamp and the last sequence number and subsequence number originated
  1567. by this node, followed by the contents of the links table.  This file
  1568. should be stored after a new bulletin (with sequence or subsequence number)
  1569. is transmitted.  Only one copy of this file need be stored.  Other tables
  1570. may be optionally stored, for diagnostic purposes, but only the links
  1571. table is required.
  1572.  
  1573. When RSPF begins to run, it looks for this file.  If present, it checks
  1574. the timestamp.   If the timestamp is recent (suggested maximum age:  no
  1575. older than twice the rspftimer), then the file should be read into the
  1576. paths table.
  1577.  
  1578.  
  1579. Acknowledgments
  1580.  
  1581. The author would like the thank the participants in the Internet
  1582. tcp-group for their assistance in preparing this, and to the various
  1583. radio amateurs who have tested RSPF 2.1 on the air, for their
  1584. assistance.  Special thanks to Anders Klemets SM0RGV for drafting the
  1585. first implementation of RSPF2.1, and to Mike Bilow N1BEE for creating a
  1586. stable implementation as well as for his assitance in editing this
  1587. revision.
  1588.  
  1589.  
  1590. Appendix A.  Router parameters
  1591.  
  1592. Every router must set a number of parameters in order to properly
  1593. operate.  While RSPF builds its routing matrix automatically, overall
  1594. network efficiency and stability may require some fine-tuning based
  1595. upon experience.  These include parameters set for each data link
  1596. or subnetwork layer entity (i.e., each radio channel) and for the
  1597. router in general.  Commands given below are not necessarily the
  1598. statements used in real implementations.
  1599.  
  1600. Link/subnet settings:
  1601.  
  1602.    Set Link cost:  This is the cost parameter based upon the link speed
  1603.     and type.  Since the overall cost of the end-to-end path is
  1604.     minimized by the RSPF spanning tree, link cost should be set to
  1605.     arrive at the best overall network performance.  The legal range
  1606.     is 1-127.  This is sent in routing update bulletins. 
  1607.  
  1608. Node settings: 
  1609.  
  1610.   Add/Delete Node group: [IPaddr]/bits {cost}.  This allows a node to 
  1611.    announce its ability to serve a group of nodes, identified using 
  1612.    the standard NOS convention of address/significant bits.  Thus a 
  1613.    node group setting of [44.56.4.1]/25 will match all nodes from
  1614.    [44.56.4.1] to [44.56.4.127].  Cost is optional; if set, this
  1615.    cost to will be propogated to reach such nodes; otherwise, the 
  1616.    link's default is used.  This is fed into the manual route table.
  1617.    **A given router may support multiple node groups; this 
  1618.    facilitatates operation near the boundary of address-subnet 
  1619.    regions.  Such a router may use a lower node group cost for its own
  1620.    node group than for adjacent (or nearby) ones, so that it is not a
  1621.    favored route to other groups.  High costs for other node groups are
  1622.    still useful because they define whether an adjacency is governed by
  1623.    horizon local or horizon portable.  (Use of a Private flag for this
  1624.    function, instead of propagating a higher cost, is for further
  1625.    study.)
  1626.  
  1627.   Set horizon link:   This sets the horizon value for the node's
  1628.    routing bulletins apropos 32-bit addresses of other adjacent
  1629.    routers.  This should be high enough to propogate across the 
  1630.    backbone, if a backbone router.
  1631.  
  1632.   Set horizon group:  This sets the horizon value for the node's
  1633.    routing bulletins apropos node group addresses (fewer than 32
  1634.    bits matched) nominally served (providing end user adjacencies) by
  1635.    this router.  Usually matches the horizon link value.
  1636.  
  1637.   Set horizon local:  This sets the horizon vaue for the node's
  1638.    routing bulletins apropos full link addresses (32 bits) to
  1639.    non-routers within the router's node group area.  This is set to
  1640.    a low value so that only other routers serving the same or 
  1641.    overlapping node group(s) will receive these messages.
  1642.  
  1643.   Set horizon portable:  This sets the horizon value for the 
  1644.    node's routing bulletins apropos full link addresses (32 bits)
  1645.    to non-router adjacencies not within a supported node group.  This
  1646.    allows portable end nodes to have their location in the network
  1647.    propogated farther than the local horizon; this is usually set the
  1648.    same as horizon group.
  1649.  
  1650.   Set RRH timer:  This sets the time, in seconds, between 
  1651.    router-router hello (RRH) broadcasts.  Initial suggestion:  900.
  1652.  
  1653.   Set RSPF timer:  This sets the time, in seconds, between newly 
  1654.    originated link state bulletins.  Initial suggestion:  900.
  1655.  
  1656.   Set suspect timer:  This sets the time, in seconds, after which
  1657.    a  connectionless adjacency is "suspect" if no packets are 
  1658.    received from it.  The route is then tested (e.g., pinged).  Initial
  1659.    suggestion:  2000.
  1660.  
  1661.   Set suspect count (maxping):  This sets the number of times an ICMP
  1662.    echo (ping) should be sent after a node is suspect, before it is
  1663.    removed from the adjacency list.  Initial suggestion:  3.
  1664.  
  1665.  
  1666. APPENDIX B.  Schematic representation of RSPF tables.
  1667.  
  1668.              ---------------------------------------------------\
  1669.             / ADJAC.        LINKS                     PATHS     | (SNAcP)
  1670.     SUBNETS-->+----+       +------+   [SPF]          +-----+    |        
  1671.               |II. |------>|V.1.1 |              --->|V.1.2|    |
  1672.     RRH IN--->|    |       |      |    TRIAL    /    |     |    |
  1673.               +----+       |      |-->+-----+  /     +-----+    |
  1674.        BULLETINS<--------->+------+   |V.1.3|-/least    |       |     
  1675.         |                   ^         |     |  cost     V       |
  1676.       +------+        non-  |         +-----+       +-------+   |
  1677.       |IV.2.4|      private |                       |V.1.2.1|  /
  1678.       |      |  +-------+--/                        |       |<-
  1679.       +------+  | V.4   |-------------------------->|       |
  1680.       ROUTERS   |       |    all manual routes      +-------+
  1681.                 +-------+                             ROUTE
  1682.                MANUAL ROUTE 
  1683.  
  1684.         Figure B.  Information flow showing relationship between
  1685.         tables.  Numbers in tables refer to sections above which
  1686.         introduce each table.
  1687.